
<?php
    echo $this->Html->link(
                        'Create', 
                        array('controller' => 'WebSurveys', 'action' => 'createTemplate'));
?>

<table>
    <tr>
        <th>Name</th>
        <th>Edit</th>
    </tr>
    <!-- Here is where we loop through our $surveys array, printing out survey info -->
    <?php foreach ($templates as $template): ?>
        <tr>
            <td><?php echo $template['WebSurvey']['name']; ?></td>
            <td><?php echo $this->Html->image('edit.png', 
                                              array('alt' => 'Edit', 
                                                    'url' => array('controller' => 'templates',
                                                                    'action'=> 'edit',
                                                                    $template['Template']['id'])));?></td>                                           
                        
            ?></td>                             
        </tr>
    <?php endforeach; ?>
<?php unset($templates); ?>
</table>
